package cn.flying.cloud.task.core.model;

import java.io.Serializable;
import java.time.LocalDateTime;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * <p>
 * 定时任务执行日志
 * </p>
 *
 * @author admin
 * @since 2025-03-16 10:29:10
 */
public class JobResult implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 流水号
     */
    private String serialNo;

    /**
     * 任务名称
     */
    private String jobName;

    /**
     * 任务分组
     */
    private String jobGroup;

    /**
     * 任务描述
     */
    private String jobDesc;

    /**
     * 执行实例
     */
    private String jobInstId;

    /**
     * 执行状态 RUNNING正在执行 SUCCESS执行成功 FAIL执行失败
     */
    private String jobStatus;

    /**
     * 描述信息
     */
    private String jobMsg;

    /**
     * 异常栈信息
     */
    private String jobTrace;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 执行时间
     */
    private LocalDateTime fireTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 租户ID
     */
    private String tenantId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getJobDesc() {
        return jobDesc;
    }

    public void setJobDesc(String jobDesc) {
        this.jobDesc = jobDesc;
    }

    public String getJobInstId() {
        return jobInstId;
    }

    public void setJobInstId(String jobInstId) {
        this.jobInstId = jobInstId;
    }

    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    public String getJobMsg() {
        return jobMsg;
    }

    public void setJobMsg(String jobMsg) {
        this.jobMsg = jobMsg;
    }

    public String getJobTrace() {
        return jobTrace;
    }

    public void setJobTrace(String jobTrace) {
        this.jobTrace = jobTrace;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getFireTime() {
        return fireTime;
    }

    public void setFireTime(LocalDateTime fireTime) {
        this.fireTime = fireTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("serialNo", serialNo)
                .append("jobName", jobName)
                .append("jobGroup", jobGroup)
                .append("jobDesc", jobDesc)
                .append("jobInstId", jobInstId)
                .append("jobStatus", jobStatus)
                .append("jobMsg", jobMsg)
                .append("jobTrace", jobTrace)
                .append("startTime", startTime)
                .append("fireTime", fireTime)
                .append("endTime", endTime)
                .append("tenantId", tenantId)
                .toString();
    }
}
